package com.cskaoyan.mapper;

import com.cskaoyan.bean.po.PermissionPO;
import com.cskaoyan.bean.po.RolePO;
import com.cskaoyan.bean.vo.FirstSystemPermissionsVO;
import com.cskaoyan.bean.vo.SecondSystemPermissionsVO;
import com.cskaoyan.bean.vo.ThirdSystemPermissionsVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface RoleMapper {
    List<RolePO> selectAllRoles(@Param("sort") String sort, @Param("order") String order, @Param("name") String name);

    int updateRole(@Param("rolePO") RolePO rolePO);

    int logicalDeleteRole(@Param("rolePO") RolePO rolePO);

    int insertRole(@Param("rolePo") RolePO rolePo);

    List<String> selectPermissionByRoleId(@Param("roleId") Integer roleId);

    List<String> selectAllPermission();

    List<FirstSystemPermissionsVO> selectSystemPermissionsByTypeId(@Param("id") int id);

    List<SecondSystemPermissionsVO> selectSystemPermissionsByPId1(@Param("pId") int pId);

    List<ThirdSystemPermissionsVO> selectSystemPermissionsByPId2(@Param("pId") int pId);

    Integer deletePermissionsByRoleId(@Param("roleId") Integer roleId);

    void insertPermissionByRoleId(@Param("permissionPO") PermissionPO permissionPO);

    String selectRolesNameById(@Param("roleId") Integer roleId);

    List<String> selectPerIdByRoleId(@Param("roleId") Integer roleId);

}
